/*
 * @Author: zhuxiaoyi
 * @Date: 2024-01-05 16:48:39
 * @LastEditor: zhuxiaoyi
 * @LastEditTime: 2025-02-24 10:58:22
 * @Description:
 */
import { defineConfig } from "vite";
import vue from "@vitejs/plugin-vue";
import * as path from "path";

const baseURL = "http://localhost"
// const baseURL = "http://192.168.101.207"


// https://vitejs.dev/config/
export default defineConfig({
  resolve: {
    //设置别名
    alias: {
      "@": path.resolve(__dirname, "src"),
    },
  },
  plugins: [vue()],
  server: {
    port: 5173, //启动端口
    hmr: {
      host: "localhost",
      port: 5173,
    },
    // 设置 https 代理
    proxy: {
      "/api": {
        // target: "http://127.0.0.1:5000/api",
        target: "http://123.57.240.141:5000/api",
        changeOrigin: true,
        rewrite: (path: string) => path.replace(/^\/api/, ""),
      },
    },
  },
});
